var t = getApp();

Page({
    data: {
        settingInfo: []
    },
    onLoad: function(t) {
        wx.setNavigationBarTitle({
            title: "置换亿栈"
        });
    },
    tourl: function(e) {
        console.log(e);
        var n = e.currentTarget.dataset.key;
        if ("is_debtor" == n && (1 == this.data.settingInfo.is_debtor || 1 == this.data.settingInfo.isset_debtor ? wx.navigateTo({
            url: "/packageF/debt/debtor/debtorindex/debtorindex"
        }) : wx.navigateTo({
            url: "/packageF/debt/debtapply/debtapply?type=2"
        })), "is_owner" == n && (1 == this.data.settingInfo.is_owner || 1 == this.data.settingInfo.isset_owner ? wx.navigateTo({
            url: "/packageF/debt/creditor/creditorindex"
        }) : wx.navigateTo({
            url: "/packageF/debt/debtapply/debtapply?type=1"
        })), "is_vip" == n) {
            if (1 == this.data.settingInfo.is_debtor || 1 == this.data.settingInfo.is_debtor.is_owner) return void t.tips("您无法申请成为VIP");
            if (1 == this.data.settingInfo.is_vip || 1 == this.data.settingInfo.isset_vip) wx.navigateTo({
                url: "/packageF/debt/vipIndex/vipIndex"
            }); else {
                if (1 == this.data.settingInfo.vip_applying) return void t.tips("vip待审核中");
                wx.navigateTo({
                    url: "/packageF/debt/debtapply/debtapply?type=3"
                });
            }
        }
    },
    onReady: function() {},
    onShow: function() {
        this.getData();
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getData: function() {
        var e = this, n = t.getNetAddresss("plugin.debt-shop.frontend.debt-member.applyData");
        t._getNetWork({
            url: n,
            success: function(t) {
                var n = t.data;
                1 == n.result ? e.setData({
                    settingInfo: n.data
                }) : wx.showToast({
                    icon: "none",
                    title: n.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    }
});